/********************************************************************************
 * Copyright 2001 - 2015 Comit. All Rights Reserved.
 * 作者：RockeyCai
 * 日期：2015-9-15 17:00:57
 * 描述：瑜伽资源表的映射模型。(自动生成，代码模块1.0v)
 * *****************************************************************************/
var _ = require('underscore');
var cheerio = require('cheerio');
var superagent = require('superagent');
var async = require('async');
module.exports = function (PAO_GIRL) {
  //var gooddriver_servicer_cloud = PAO_GIRL.app.dataSources.gooddriver_servicer_cloud;
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel = function (req, res, index) {

    console.log('addModel');

    var thisId = 17639078;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "教你怎样搭讪女生";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            res.send("0");
          });
        });
      });
  }



  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel22344235 = function (req, res, index) {

    console.log('addModel');

    var thisId = 22344235;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "泡妞-技巧";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 2){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel22344256 = function (req, res, index) {

    console.log('addModel');

    var thisId = 22344256;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "泡妞-策略";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel22340864 = function (req, res, index) {

    console.log('addModel');

    var thisId = 22340864;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "泡妞-搭讪";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel22342565 = function (req, res, index) {

    console.log('addModel');

    var thisId = 22342565;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "泡妞-话题";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel18591707 = function (req, res, index) {

    console.log('addModel');

    var thisId = 18591707;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "夜店泡妞热舞教学(中文字幕)";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel18563710 = function (req, res, index) {

    console.log('addModel');

    var thisId = 18563710;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "夜总会如何与辣妹贴身热舞";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel18664613 = function (req, res, index) {

    console.log('addModel');

    var thisId = 18664613;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "郑匡宇泡妞秘籍";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel21300201 = function (req, res, index) {

    console.log('addModel');

    var thisId = 21300201;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "牛男泡妞";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel22341748 = function (req, res, index) {

    console.log('addModel');

    var thisId = 22341748;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "泡妞-实战";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel18368275 = function (req, res, index) {

    console.log('addModel');

    var thisId = 18368275;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "搭讪美女教程";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel19489878 = function (req, res, index) {

    console.log('addModel');

    var thisId = 19489878;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "约会技巧";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel18546346 = function (req, res, index) {

    console.log('addModel');

    var thisId = 18546346;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "泡妞特辑";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel23748372 = function (req, res, index) {

    console.log('addModel');

    var thisId = 23748372;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "Max约会教室";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel22341813 = function (req, res, index) {

    console.log('addModel');

    var thisId = 22341813;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "泡妞-夜店";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel19556867 = function (req, res, index) {

    console.log('addModel');

    var thisId = 19556867;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "美女们的恋爱观";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel22341769 = function (req, res, index) {

    console.log('addModel');

    var thisId = 22341769;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "泡妞-表白";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel22342018 = function (req, res, index) {

    console.log('addModel');

    var thisId = 22342018;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "泡妞-约会";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }
  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel22342101 = function (req, res, index) {

    console.log('addModel');

    var thisId = 22342101;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "泡妞-交谈";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }

  /**
   * 添加瑜伽资源表对象
   * @param req
   * @param res
   */
  PAO_GIRL.addModel18365578 = function (req, res, index) {

    console.log('addModel');

    var thisId = 18365578;

    superagent.get('http://v.youku.com/v_vpvideoplaylistv5?__rt=1&__ro=&s=0&f=' + thisId + '&o=1&vid=165759772&pl=50&pn=' + index + '&t=2')
      .end(function (err, sres) {
        if (err) {
          console.log(err)
        }

        var $ = cheerio.load(sres.text);
        var liList = $('li');
        async.eachSeries(liList, function (element, callback) {
          //item_
          var id = $(element).attr('id');
          id = id.substring(5, id.length);
          var title = $(element).attr('title');
          var l_order = $(element).find('.l_order .num');
          var l_time = $(element).find('.l_time .num');
          var img = $(element).find('img').attr('_src');

          var item = {};
          item.URL = 'http://player.youku.com/embed/' + id;
          //item.ID = Number(l_order.text()) + thisId;
          item.ID = new Date().valueOf();
          item.IMG = img;
          item.TIME = l_time.text();
          title = title.replace('【牛男独家】', '');
          title = title.replace('未删节版：', '');
          title = title.replace('【网络牛人教你泡妞】', '');
          title = title.replace('【辣妹教你泡妞】', '');
          title = title.replace('【真人接吻教学】', '');
          title = title.replace('【泡妞教学】', '');
          title = title.replace('【教你泡妞】', '');
          title = title.replace('【牛男泡妞】', '');
          title = title.replace('泡妞教学：', '');
          title = title.replace('（牛男字幕组）', '');
          title = title.replace('(牛男字幕组)', '');
          title = title.replace('（牛男字幕）', '');
          title = title.replace('网络牛人教你泡妞：', '');
          title = title.replace('牛男泡妞教程：', '');
          title = title.replace('网上牛人泡妞教程：', '');
          item.TITLE = title;
          item.PID = thisId;
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
              callback(null , obj.ID + "保存失败" );
            } else {
              console.log(obj.ID + "保存成功")
              callback(null , obj.ID + "保存成功" );
            }
          });
        }, function (error , results) {

          var item = {};
          item.ID = thisId;
          item.TITLE = "蓝图解码课程";
          //保存记录
          PAO_GIRL.create(item, function (err, obj) {
            if (err) {
              console.log(err)
              console.log(obj.ID + "保存失败")
            } else {
              console.log(obj.ID + "保存成功")
            }
            if(index == 1){
              //res.send("0");
            }
          });
        });
      });
  }

}
